﻿namespace ManagerClinic.Controls
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Drawing;
    using System.Data;
    using System.Text;
    using System.Windows.Forms;
    using DevExpress.XtraEditors;
    using ManagerClinic.Core.Business;
    using ManagerClinic.Core.Common;

    public partial class ucThongTinHanhChinh : DevExpress.XtraEditors.XtraUserControl
    {
        DmBenhNhanEntity dmBenhNhanEntity = null;
        DmBenhNhanBusiness dmBenhNhanBusiness = null;

        public ucThongTinHanhChinh()
        {
            InitializeComponent();
            this.lblSoPhieu.Text = string.Empty;

            dmBenhNhanBusiness = new DmBenhNhanBusiness();
        }

        private void ucThongTinHanhChinh_Load(object sender, EventArgs e)
        {

        }

        public void LoadThongTinHanhChinh(string maBenhNhan)
        {
            dmBenhNhanEntity = dmBenhNhanBusiness.GetDmBenhNhan(maBenhNhan);
            txtMaBenhNhan.Text = dmBenhNhanEntity.MaBenhNhan;
            txtTenBenhNhan.Text = dmBenhNhanEntity.TenBenhNhan;
            txtNgaySinh.Text = dmBenhNhanEntity.NgaySinh;
            txtThangSinh.Text = dmBenhNhanEntity.ThangSinh;
            txtNamSinh.Text = dmBenhNhanEntity.NamSinh.ToString();
            txtGioiTinh.Text = dmBenhNhanEntity.TenGioiTinh;
            txtDanToc.Text = dmBenhNhanEntity.TenDanToc;
            txtNgheNghiep.Text = dmBenhNhanEntity.TenNgheNghiep;
            txtDiaChi.Text = dmBenhNhanEntity.DiaChi;
        }

        public void LoadSoPhieu(int soPhieu)
        {
            lblSoPhieu.Text = string.Format("Số phiếu: {0}", soPhieu);
        }
    }
}
